package com.sky.com.admin.controller;

import com.itheima.JsonResult;
import com.sky.com.admin.entity.DTO.AdminLoginDTO;
import com.sky.com.admin.service.AdminService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 管理员表 前端控制器
 * </p>
 *
 * @author wuyunbin
 * @since 2022-12-08
 */
@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private AdminService adminService;
@PostMapping("/login")
    public JsonResult adminLogin(@RequestBody AdminLoginDTO adminLoginDTO){
        String token = adminService.adminLogin(adminLoginDTO);
        return JsonResult.sucess(token);
    }

}
